﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Lapv.Master" AutoEventWireup="true"
    CodeBehind="CommentMN.aspx.cs" Inherits="Lapv.page.CommentMN" %>

<%@ Register Namespace="ASPnetControls" Assembly="ASPnetPagerV2_8" TagPrefix="cc" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="header" runat="server">
  <%--menu tab  --%>
    <div class="tabnav">
        <ul>
            <li  class="active"><a href="<%= domain%>Pages/CommentMN.aspx" class="list_t">D/s bình luận</a></li>
            
        </ul>
        <div class="clr">
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="content" runat="server">
<%--box action --%>
    <div class="action">
        <ul>
            <li>
                <label>Chọn loại tin:</label>
                <asp:DropDownList ID="ddlCate" runat="server" OnSelectedIndexChanged="ChangeCateSelectIndex" AutoPostBack="true"></asp:DropDownList>
            </li>
            <li>
                <label>Chọn tên tin:</label>
                <asp:DropDownList ID="ddlNews" runat="server" OnSelectedIndexChanged="ChangeSelectIndex" AutoPostBack="true"></asp:DropDownList>
            </li>
            <li>
                <label>Chọn tình trạng tin:</label>
                <asp:DropDownList ID="ddlStatus" runat="server" OnSelectedIndexChanged="ChangeSelectIndex" AutoPostBack="true">
                    <asp:ListItem Text="Tất cả" Value="-1"></asp:ListItem>
                    <asp:ListItem Text="Đã duyệt" Value="1"></asp:ListItem>
                    <asp:ListItem Text="Chưa duyệt" Value="0"></asp:ListItem>
                </asp:DropDownList>
            </li>
        </ul>
        <div class="clr">
        </div>
    </div>
    <div class="form form2">
        <asp:DataGrid CssClass="table1" runat="server" ID="dtgrid" AutoGenerateColumns="false" OnItemCommand="functionGridNews"  OnItemDataBound="dtgrid_ItemDataBound">
            <Columns>
                <asp:TemplateColumn ItemStyle-Width="3%" ItemStyle-Height="5%" HeaderText="ID" >
                    <ItemTemplate>
                        <asp:Label runat="server" ID="lb_id" Text='<%# Eval("id") %>' />
                    </ItemTemplate>
                </asp:TemplateColumn>                
                <asp:TemplateColumn HeaderText="Nội dung" ItemStyle-Width="40%">
                    <ItemTemplate>
                        <%# Eval("content")%>
                    </ItemTemplate>
                </asp:TemplateColumn>
                <asp:TemplateColumn HeaderText="Ip" ItemStyle-Width="5%">
                    <ItemTemplate>
                        <%# Eval("ip")%>
                    </ItemTemplate>
                </asp:TemplateColumn>
                <asp:TemplateColumn HeaderText="Ngày tạo" ItemStyle-Width="10%">
                    <ItemTemplate>
                        <%# ((DateTime)DataBinder.Eval(Container.DataItem, "datecreate")).ToString("dd/MM/yyyy hh:mm tt")%> 
                    </ItemTemplate>
                </asp:TemplateColumn>
                <asp:TemplateColumn HeaderText="Trạng thái" ItemStyle-Width="10%">
                    <ItemTemplate>
                        <%#getStatus((bool)Eval("status"))%>
                    </ItemTemplate>
                </asp:TemplateColumn>
                <asp:TemplateColumn HeaderText="Kiểm duyệt" ItemStyle-Width="5%">
                    <ItemTemplate>
                        <asp:LinkButton runat="server" ID="lbtEdit" CommandName="edit" Text='Kiểm duyệt' CommandArgument='<%# Eval("id") %>'>
                                        <img alt="Sửa" src="../styles/imgs/edit.gif" border="0" />
                        </asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateColumn>
                
                <asp:TemplateColumn HeaderText="Xóa" ItemStyle-Width="5%">
                    <ItemTemplate>
                        <asp:ImageButton OnClick="btnDelete_Click" ID="btnDelete" ImageUrl="~/styles/imgs/delete.gif"
                            runat="server" BorderWidth="0" CommandArgument='<%# Eval("id") %>' OnClientClick="return confirm('Xóa tin vĩnh viễn?')" />
                    </ItemTemplate>
                </asp:TemplateColumn>
            </Columns>
        </asp:DataGrid>
    </div>
    <div class="form pager">
        <div class="p_ddl">
            Number Record:
            <asp:DropDownList ID="ddlPaged" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlPaged_SelectedIndexChanged">
            </asp:DropDownList>
        </div>
        <div class="p_pager">
            <cc:PagerV2_8 ID="pager1" runat="server" OnCommand="pager_Command" GenerateGoToSection="true" />
        </div>
    </div>
</asp:Content>
